class CreateUsersRights < ActiveRecord::Migration
  def self.up
    create_table :users_rights do |t|
      t.integer :right_id     ,:limit => 2,:default => 0
      t.integer :user_id
      t.integer  :forbidden  ,:limit => 1,:default => 0
      t.timestamps
    end
    UsersRight.create(:user_id => 1,:right_id => 1,:forbidden=>'false')
    UsersRight.create(:user_id => 1,:right_id => 2,:forbidden=>'false')
    UsersRight.create(:user_id => 1,:right_id => 3,:forbidden=>'false')
    UsersRight.create(:user_id => 2,:right_id => 1,:forbidden=>'false')
    UsersRight.create(:user_id => 3,:right_id => 2,:forbidden=>'false')
  end
  
  def self.down
    drop_table :users_rights
  end
end
